﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sudoku
{
    class AdvanceTechniques
    {
        // variable
        public static int [,] grid;
        public static String [,] possible;
        public static String [,] data;

        public bool LookForTwinsinMinigrids();
        public bool LookForTwinsinRows();
        public bool LookForTwinsinColumns();
        public bool LookForTripletsinMinigrids();
        public bool LookForTripletsinRows();
        public bool LookForTripletsinColumns();
        public bool SolvePuzzle();

        // Solve puzzle
        public bool SolvePuzzle()
        {
            // FOR TEST
            data = new string[9, 9]{  {"4", "", "3", "", "", "8", "", "", ""}, 
                                {"9", "2", "", "", "", "", "1", "", "6"},
                                {"", "", "", "", "", "6", "", "", ""},
                                {"5", "", "6", "", "2", "", "", "", ""},
                                {"", "4", "", "3", "", "1", "", "2", ""},
                                {"", "", "", "", "7", "", "9", "", "8"},
                                {"", "", "", "7", "", "", "", "", ""},
                                {"3", "", "5", "", "", "", "", "1", "2"},
                                {"", "", "", "1", "", "", "5", "", "9"}};

            CRME crme = new CRME(data);

            IntermediateTechniques intermediate = new IntermediateTechniques();

            intermediate.data = crme.init();
            intermediate.init();

            // Do something with twins and triplets

            return true;
        }
    }

}
